
from base import BaseView
from interfaces import ISearchView
from zope.interface import implements
from zope.viewlet.viewlet import ViewletBase

class SearchView(BaseView):
    # Often a special interface is needed for viewlet registrations
    # We might not need this, since you can register stuff for a class,
    # though there are cases we found where it did not work.
    implements(ISearchView)


class SearchViewlet(ViewletBase):
    """ SearchViewlet """

    def update(self):
        query = self.request.form.get('query')
        if query:
            self.results ="""you're query is "%s" """ % query
        else:
            self.results = "Type in a query"
